package com.springcloud.mq.listener;

import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.stereotype.Component;

/**
 * @Author 咕唧
 * @Date 2022/6/28 21:06
 * @Version 1.0
 */
@Component
public class MyStreamListener {

    //@StreamListener("message") //监听指定的交换机,会自动创建队列并绑定
    @ServiceActivator(inputChannel = "message")//收消息的方式2
    public void onMessage(String msg) {
        System.out.println("MyStreamListener的onMessage方法执行了:" + msg);
    }
}
